<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .wrap{
            width: 100px;
            height: 100px;
            background-color: red;
        }

    </style>
</head>
<body>
    <div class="wrap"></div>
    <button class="button">按钮</button>
    <script>
        var  wrap =document.querySelector(".wrap")
        var but = document.querySelector(".button")
        wrap.onclick= function(){
            console.log("0级事件")
        }
        but.addEventListener("click",function(){
            console.log("2级事件")
        })
    </script>
</body>
</html>